|
Mobile API Reference
MicroStrategy 2019
|
#import <MSIUtility.h>
A singleton with a variety of class methods for handling colors, strings, device info, etc.
| + (int) colorAdjust: | (int) | oriColor | |
| withDarker: | (BOOL) | isDarker | |
Tune the given color brighter or darker
| input | oriColor, represent by integer with 'RGB' order |
| input | isDarker, indicating we should tune the color darker or brighter |
| + (int) colorAdjust: | (int) | oriColor | |
| withVFactor: | (float) | vFactor | |
Tune the given color brighter or darker
| input | oriColor, represent by integer with 'RGB' order |
| input | vFactor, indicating the percentage of current lightness, if vFactor less than 1, tune oriColor darker, else brighter |
| + (UIColor*) colorFromInteger: | (NSInteger) | iValue |
Reture UIColor instance from a integer save in 'RGB' order
| iValue,integer | representing a color saved in 'RGB' order |
| + (UIColor*) colorFromInteger: | (NSInteger) | iValue | |
| rgbReversed: | (BOOL) | iIsRGBReversed | |
Please note the color info is saved as BGR instead of RGB in the grid and CE Returns UIColor instance from a integer save in 'RGB' order
| iValue,integer | representing a color |
| iIsRGBReversed,if | iIsRGBReversed is TRUE, indicating color is saved in order 'BGR' in iValue |
| + (BOOL) colorIsBright: | (int) | redComp | |
| withGreen: | (int) | greenComp | |
| withBlue: | (int) | blueComp | |
Determine whether the given color is a bright color or not
| input | redComp, red componet |
| output | greenComp, green componet |
| output | blueComp, blue componet |
| + (void) colorToRgb: | (UIColor *) | ipColor | |
| withR: | (CGFloat *) | opR | |
| andG: | (CGFloat *) | opG | |
| andB: | (CGFloat *) | opB | |
Extract R, G, B values in RGB color space from a UIColor object. The output parameters *opR, *opG, *opB are all in [0, 1].
| ipColor | the UIColor object. |
| opR | output R value in RGB color space. |
| opG | output G value in RGB color space. |
| opB | output B value in RGB color space. |
| + (int) compCGFloat: | (CGFloat) | iLeft | |
| right: | (CGFloat) | iRight | |
Compare two float numbers. If the difference between two numbers is inside the accuracy of float number (FLT_EPSILON), they are treated as equal.
| iLeft | the first number to be compared. |
| iRight | the second number to be comared. |
| + (UIImage*) createGrayScaleImageFromImage: | (UIImage *) | image |
This method is used to create a new grayed image based on the source image provided in the parameter.
| image | the source image that is to be translated. |
| + (NSInteger) darkerHex: | (NSInteger) | hex | |
| percentage: | (CGFloat) | prc | |
| + (int) daysOfMonth: | (int) | month | |
| withYear: | (int) | year | |
Get the number of days in a given month
| input | month, given month ranging from 1 to 12 |
| input | year, given year represented by four digits |
| + (float) distanceBetween: | (CGPoint) | a | |
| andPoint: | (CGPoint) | b | |
Calculate the distace between two CGPoints.
| a | the first CGPoint. |
| b | the second CGPoint. |
| + (NSString*) findImageNameFromPath: | (NSString *) | imagePath |
Get file name of image by parsing the given path
| input | imagePath, the full path of image |
| + (CGRect) getBestResolution: | (UIScreen *) | screen |
Get the largest resolution for a screen instance
| screen | the screen instance |
| + (int) getCalculatedGradient: | (int) | oriColor |
| + (NSInteger) getColorInGradientRange: | (float) | index | |
| startColor: | (NSInteger) | iStartColor | |
| endColor: | (NSInteger) | iEndColor | |
| + (NSInteger) getContrastColor: | (NSInteger) | iGivenColor |
| + (NSString*) getDescriptionStringFromDataSet: | (void *) | dataSet |
For the scaling to width feature on iPhone. Get the scale ratio for the current layout.
| ratio | The value of the scale ratio for the current layout. Get description From DataSet, used in accessibility |
| input | dataSet |
Provided by category MSIUtility(Internal).
| + (float) getHonestZoomScale |
Provided by category MSIUtility(Internal).
| + (float) getLastHonestZoomScale |
Provided by category MSIUtility(Internal).
| + (EnumLogOption) getLogOption |
Provided by category MSIUtility(Internal).
| + (CGSize) GetMeasuredTextSize: | (const char *) | ipString | |
| withFontSize: | (float) | iFontSize | |
| withFontName: | (const char *) | ipFontName | |
To layout the text under specified font type and font size.
| ipString,the | text to layout. |
| iFontSize,to | denote how big the font is. |
| ipFontName,to | denote which font is chosen to render the font. the size (bounding rectangle) of the text. |
| + (UIView*) getRootViewer: | (UIView *) | iView |
Get the root view of the view hierarchy that the specific view is in.
| iView | the specific view of the view hierarchy; nil is allowed. |
| + (RootViewerContainer*) getRootViewerContainer |
Get the RootViewerContainer view. RootViewerContainer view is the root view for a dashboard.
| + (float) getScaleRatio |
| + (CGFloat) GetTextSizeByUILabel: | (NSString *) | ipString | |
| withFontSize: | (float) | iFontSize | |
| withFontName: | (NSString *) | ipFontName | |
Get text width by set the string to a UILabel and fitToSize.
| input | ipString the NSString to measure |
| input | iFontSize font size used to display the ipString |
| input | ipFontName font name used to get the font which is used to display the text. |
| + (CGSize) GetTextWidthHeightByUILabel: | (NSString *) | ipString | |
| withFontSize: | (float) | iFontSize | |
| withFontName: | (NSString *) | ipFontName | |
Get text size by set the string to a UILabel and fitToSize.
| input | ipString the NSString to measure |
| input | iFontSize font size used to display the ipString |
| input | ipFontName font name used to get the font which is used to display the text. |
| + (CGSize) getUISwitchFrameSize |
Get UISwitch frame size.
Provided by category MSIUtility(Internal).
| + (float) getZoomScale |
Get the current zoom scale of dashboard. The returned value is valid only after current zoom gesture (double-tapping or pinching) ends.
| + (int) hexStringToInt: | (NSString *) | ipString |
| + (void) hsvToRgb: | (CGFloat) | iH | |
| withS: | (CGFloat) | iS | |
| andV: | (CGFloat) | iV | |
| andR: | (CGFloat *) | opR | |
| andG: | (CGFloat *) | opG | |
| andB: | (CGFloat *) | opB | |
Convert H, S, V values in HSV color space to R, G, B values in RGB color space. The parameters iH, iS, iV, *opR, *opG, *opB are all in [0, 1].
| iH | input H value in HSV color space. |
| iS | input S value in HSV color space. |
| iV | input V value in HSV color space. |
| opR | output R value in RGB color space. |
| opG | output G value in RGB color space. |
| opB | output B value in RGB color space. |
| + (float) inchesToPixles: | (float) | iInches |
Map the length in inches to pixles.
| iInches,the | input length in inches to be mapped. |
Provided by category MSIUtility(Internal).
| + (float) inchesToPixles: | (float) | iInches | |
| scaleRatio: | (float) | iScaleRatio | |
Provided by category MSIUtility(Internal).
| + (float) inchesToPixlesWithoutRound: | (float) | iInches |
Special case. Need return float without round.
Provided by category MSIUtility(Internal).
| + (float) inchesToPixlesWithoutRound: | (float) | iInches | |
| scaleRatio: | (float) | iScaleRatio | |
Provided by category MSIUtility(Internal).
| + (int) intFromBGRToRGB: | (int) | iValue |
Get another integer repsenting the same color from order 'BGR' to 'RGB'
| input | iValue, represent by integer with 'BGR' order |
| + (void) IntToRGB2: | (int) | iValue | |
| withRed: | (CGFloat *) | opRed | |
| andGreen: | (CGFloat *) | opGreen | |
| andBlue: | (CGFloat *) | opBlue | |
Get components of a given color
| input | iValue, represent by integer with 'RGB' order |
| output | opRed, red componet of color 'iValue' |
| output | opGreen, green componet of color 'iValue' |
| output | opBlue, blue componet of color 'iValue' |
| + (void) IntToRGB: | (int) | iValue | |
| withRed: | (CGFloat *) | opRed | |
| andGreen: | (CGFloat *) | opGreen | |
| andBlue: | (CGFloat *) | opBlue | |
Returns components of a given color
| input | iValue, represent by integer in 'BGR' order |
| output | opRed, red componet of color 'iValue' |
| output | opGreen, green componet of color 'iValue' |
| output | opBlue, blue componet of color 'iValue' |
| + (bool) IsAirplay |
Get whether it is in Airplay mode now
| + (BOOL) isDashboardZooming |
Check whether the dashboard is not in 100% scale.
| + (BOOL) isDuringDoubleTapOrPinchZooming |
Check whether the dashboard is being zoomed by pinching or double-tapping gesture. Note the end of double-tapping are defined as the end of zooming animation.
| + (BOOL) isIPad |
Get whether the device is iPad or iPhone.
Provided by category MSIUtility(Internal).
| + (BOOL) isLandscape |
Check whether the current view hierarchy is in landscape mode or not.
| + (BOOL) isRendering |
Get whether app is rendering any dashboard.
Provided by category MSIUtility(Internal).
| + (void) lastMonth: | (int) | month | |
| withYear: | (int) | year | |
| toLastMonth: | (int *) | lastMonth | |
| toYear: | (int *) | lastYear | |
Get the value of last month, according to a given month. e.g., input month = 12, year = 2012, output lastMonth = 11, lastYear = 2012
| input | month, given month ranging from 1 to 12 |
| input | year, given year represented by four digits |
| output | lastMonth ranging from 1 to 12 |
| output | lastYear represented by four digits |
| + (void) markIndication: | (CGContextRef) | iCurrentContext | |
| inRect: | (CGRect) | iRect | |
Mark a grid cell with orange triangle flag on the upper right corner
| iCurrentContext | the CGContext instance where the drawing will happen |
| iRect | the anchor rectagle within which to draw the orange triangle |
| + (void) nextMonth: | (int) | month | |
| withYear: | (int) | year | |
| toNextMonth: | (int *) | nextMonth | |
| toYear: | (int *) | nextYear | |
Get the value of next month, according to a given month. e.g., input month = 12, year = 2012, output nextMonth = 1, nextYear = 2013
| input | month, given month ranging from 1 to 12 |
| input | year, given year represented by four digits |
| output | nextMonth ranging from 1 to 12 |
| output | nextYear represented by four digits |
| + (float) pixelsToInches: | (float) | iPixels |
Map the length in pixles to inches.
| iPixels,the | input length in pixles to be mapped. |
Provided by category MSIUtility(Internal).
| + (float) pointsToPixles: | (float) | iPoints | |
| scaleRatio: | (float) | iScaleRatio | |
Map the length in points to pixles.
| iPoints,the | input length in points to be mapped. |
Provided by category MSIUtility(Internal).
| + (float) pointsToPixlesWithoutRound: | (float) | iPoints | |
| scaleRatio: | (float) | iScaleRatio | |
Special case. Need return float without round.
Provided by category MSIUtility(Internal).
| + (void) printSubtree: | (UIView *) | ipView |
Provided by category MSIUtility(Internal).
| + (void) resetSDKScaleRatio |
| + (void) rgbToHsv: | (CGFloat) | iR | |
| withG: | (CGFloat) | iG | |
| andB: | (CGFloat) | iB | |
| andH: | (CGFloat *) | opH | |
| andS: | (CGFloat *) | opS | |
| andV: | (CGFloat *) | opV | |
Convert R, G, B values in RGB color space to H, S, V values in HSV color space. The parameters iR, iG, iB, *opH, *opS, *opV are all in [0, 1].
| iR | input R value in RGB color space. |
| iG | input G value in RGB color space. |
| iB | input B value in RGB color space. |
| opH | output H value in HSV color space. |
| opS | output S value in HSV color space. |
| opV | output V value in HSV color space. |
| + (int) rotatingStatus |
| + (void) setBarButtonItems: | (NSArray *) | iButtonArray | |
| toNavigationItem: | (UINavigationItem *) | iNavigationItem | |
| atLeft: | (BOOL) | iAtLeft | |
| animated: | (BOOL) | iAnimated | |
Set the BarButtonItems to one side of a navigationItem. If iOS is earlier than 5.0, then only the first barButtonItem is set.
| iButtonArray | the BarButtonItems |
| iNavigationItem | the navigationItem |
| iAtLeft | whether set it at the left side |
| iAnimated | whether we set the BarButtonItems animatedly |
Provided by category MSIUtility(Internal).
| + (void) setHonestZoomScale: | (float) | scale |
Provided by category MSIUtility(Internal).
| + (void) setIsAirplay: | (bool) | _isAirplay |
Set whether it is in Airplay mode now
| _isAirplay | whether it is Airplay mode now |
| + (void) setIsDuringDoubleTapOrPinchZooming: | (BOOL) | isDuring |
Provided by category MSIUtility(Internal).
| + (void) setIsRendering: | (BOOL) | rendering |
Set whether app is rendering a dashboard.
| ratio | The value of the scale ratio for the current layout. |
Provided by category MSIUtility(Internal).
| + (void) setLandscape: | (BOOL) | isLandscape |
Provided by category MSIUtility(Internal).
| + (void) setRootViewerContainer: | (RootViewerContainer *) | iRootView |
Provided by category MSIUtility(Internal).
| + (void) setRotatingStatus: | (int) | status |
| + (void) setScaleRatio: | (float) | ratio |
| + (void) setSDKScaleRatio: | (float) | ratio |
| + (void) setZoomScale: | (float) | scale |
Provided by category MSIUtility(Internal).
| + (bool) stringToRGB: | (NSString *) | ipString | |
| withRed: | (float *) | opRed | |
| andGreen: | (float *) | opGreen | |
| andBlue: | (float *) | opBlue | |
Map a string value to its corresponding RGB representation.
| ipString,the | string to be mapped. This one should NOT be null. |
| opRed,the | red component value in the mapped RGB result. |
| opGreen,the | green component value in the mapped RGB result. |
| opBlue,the | blue component value in the mapped RGB result. |
| + (bool) supportRefreshWindowForEveryMoveInGrid |
For grid use, whether we will refresh current window screen for each UIScrollView Move in Grid. Basically, it checked whether it's iPad2 device or not.
| + (void) updateHighScaleFactorToViews: | (UIView *) | iView |
Update the resolution of the given view and its subviews to make them clear (i.e., treat them all as on-screen views).
Use allWithGivenFactor:(CGFloat) to update resolutions.
| iView | the specific view of the view hierarchy; nil is not allowed. |
| + (void) updateScaleFactorToViews: | (UIView *) | iView | |
| allWithGivenFactor: | (CGFloat) | iFactor | |
Update the resolution of the given view and its subviews to given value.
| iView | the specific view of the view hierarchy; nil is not allowed. |
| iFactor | the given scaleFactor. |
| + (void) updateSubFieldGroupViewers: | (UIView *) | ipView |
This method is used to update field group viewer's width, if the field group viewer's width mode is by percent
| the | field group viewer that will be updated |
| + (void) updateZoomScale: | (UIView *) | iView |
Update the given view and its subviews to proper resolution: make the views on-screen clear and make the views off-screen blurry.
| iView | the specific view of the view hierarchy. If you pass nil or an NSNull object, then it will use the content view of RootViewerContainer instead. |
| + (bool) willUseLaserPointer |
Get whether the app will enter laser pointer mode
| + (string MSIUtility(Internal)): | (const wchar_t *) | ipWSource |
Provided by category MSIUtility(Internal).