/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*----------------------------------------------------------------------------*/
/*! @file u_wgl_bdr_common.h 
 *  $RCSfile: $
 *  $Revision: #1 $
 *  $Date: 2015/05/29 $
 *  $Author: brianpc.huang $
 *  
 *  @par Description:
 *         This header file contains public interfaces, constant and type 
 *         definitions of the Widget Library.
 */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/*! @addtogroup groupMW_WGL
 *  @{ 
 */
/*----------------------------------------------------------------------------*/

 
#ifndef _U_WGL_BDR_COMMON_H_
#define _U_WGL_BDR_COMMON_H_

/*-----------------------------------------------------------------------------
                    include files
 ----------------------------------------------------------------------------*/
#include "u_wgl_common.h"


/*-----------------------------------------------------------------------------
                    general command definition
 ----------------------------------------------------------------------------*/
/**
This command sets the inset of the specified border. If the inputted inset is too large to fit 
into the widget, or the inputted inset is too small for the border, the command fails.

Input arguments

pv_param1	References a WGL_INSET_T structure. This argument must be of type (WGL_INSET_T *). A 
NULL value of this argument indicates the default inset of this border will be used.

pv_param2	Not used. This argument must be NULL.

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	The inputted inset is not valid.
*/
#define WGL_CMD_GL_SET_INSET                    WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 0)    

/**
This command gets the inset of the specified border.

Input arguments

pv_param2	Not used. This argument must be NULL.

Output arguments

pv_param1	Returns the inset of the border. This argument must be of type (WGL_INSET_T *). This 
argument cannot be NULL.

Returns

WGLR_OK	The command is successful.
*/
#define WGL_CMD_GL_GET_INSET                    WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 1)    

/**
This command queries the minimum inset of the specified border.

Input arguments

pv_param2	Not used. This argument must be NULL.

Output arguments

pv_param1	Returns the minimum inset of the border. This argument must be of type (WGL_INSET_T *). 
This argument cannot be NULL.

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	pv_param1 is NULL.
*/
#define WGL_CMD_GL_GET_MIN_INSET                WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 2)    

/**
This command sets a BOOL flag indicating whether the border draws the interior part or not. The 
interior part is the portion of a widget that content occupy. 

Input arguments

pv_param1	Contains a BOOL variable indicating whether the border draws interior or not. This 
argument must be of type BOOL.

pv_param2	Not used. This argument must be NULL.

Returns

WGLR_OK	The command is successful.
*/
#define WGL_CMD_GL_SET_IS_BDR_DRAW_INTERIOR     WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 3)    

/**
This command gets a BOOL flag indicating whether the border draws the interior part or not. The 
interior part is the portion of a widget that content occupy. 

Input arguments

pv_param2	Not used. This argument must be NULL.

Output arguments

pv_param1	Returns a BOOL variable indicating whether the border draws interior or not. This 
argument must be of type (BOOL *). This argument cannot be NULL.

Returns

WGLR_OK	The command is successful.
*/
#define WGL_CMD_GL_GET_IS_BDR_DRAW_INTERIOR     WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 4)    

/**
This command sets the foreground color, background color or other type of color defined in 
specific border. The type of color to be set is indicated in pv_param1. The type of color-set and 
the value of the color-set are specified in pv_param2, which is the pointer of the structure 
WGL_COLOR_INFO_T. Note that the choice of the color-set (WGL_COLOR_SET_BASIC, 
WGL_COLOR_SET_STANDARD or WGL_COLOR_SET_EXTEND) depends on which type of the border's host widget
. For example, if the border's host widget is an Icon widget, which has three states: disabled, 
enabled, and focused, it's strongly recommended to choose the color-set type 
WGL_COLOR_SET_STANDARD. If the border's host widget is a Button widget, which has an additional 
state: pushed state, it's recommended to choose the color-set type WGL_COLOR_SET_EXTEND. 

Input arguments

pv_param1	Contains the target type of color to be set. Some available color targets are such as 
WGL_CLR_BDR_BK and WGL_CLR_BDR_FG. More color targets are independently available for each type 
of border. For example, "uniform border" has additional specific color targets such as 
WGL_CLR_BDR_UNFM_INNER_BK, WGL_CLR_BDR_UNFM_TITLE_TEXT, or WGL_CLR_BDR_UNFM_TITLE_TEXT_BK. Note 
that the specific color targets can only be applied on the corresponding border component. For 
more information about the available target color types that are general for all types of borders
, refer to the section "General Border Color Command Target". For the specific color targets for 
each border, refer to the "Border Color Command Target" section in each border's documentation.

pv_param2	Contains the color information. This argument must be of type (WGL_COLOR_INFO_T *). If 
this argument is NULL, the default color will be used. For more information about the structure 
WGL_COLOR_INFO_T, refer to the document "SW Design Middleware - WGL Common Widget". Note that the 
choice of the color-set (WGL_COLOR_SET_BASIC, WGL_COLOR_SET_STANDARD or WGL_COLOR_SET_EXTEND) 
depends on the type of the border's host widget.

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	The target type of color specified in argument pv_param1 is invalid.
*/
#define WGL_CMD_GL_SET_BDR_COLOR                WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 5)  

/**
This command queries the foreground color, background color or other type of color defined in 
specific border. The type of color to be queried is indicated in pv_param1. 

Input arguments

pv_param1	Contains the target type of color to be queried. Some available color targets are such 
as WGL_CLR_BDR_BK and WGL_CLR_BDR_FG. More color targets are independently available for each 
type of border. For example, "uniform border" has additional specific color targets such as 
WGL_CLR_BDR_UNFM_INNER_BK, WGL_CLR_BDR_UNFM_TITLE_TEXT, or WGL_CLR_BDR_UNFM_TITLE_TEXT_BK. Note 
that the specific color targets can only be applied on the corresponding border component. For 
more information about the available target color types that are general for all types of borders
, refer to the section "General Border Color Command Target". For the specific color targets for 
each border, refer to the "Border Color Command Target" section in each border's documentation.

Output arguments

pv_param2	Returns the color information. This argument must be of type (WGL_COLOR_INFO_T *). This 
argument cannot be NULL. For more information about the structure WGL_COLOR_INFO_T, refer to the 
document "SW Design Middleware - WGL Common Widget".

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	At least one of the following cases occurs:
 	The target type of color specified in argument pv_param1 is invalid
 	The argument pv_param2 is NULL.
*/
#define WGL_CMD_GL_GET_BDR_COLOR                WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 6)  

/**
This command sets the text direction attribute that defined in specific border. It indicates the 
border text direction (WGL_TEXT_DIR_BDR_LEFT_TO_RIGHT or WGL_TEXT_DIR_BDR_RIGHT_TO_LEFT)

Input arguments

pv_param1	Contains the text direction value.It maybe WGL_TEXT_DIR_BDR_LEFT_TO_RIGHT or 
WGL_TEXT_DIR_BDR_RIGHT_TO_LEFT.

pv_param2	Reserve.

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	The text direction is not WGL_TEXT_DIR_BDR_LEFT_TO_RIGHT or 

WGL_TEXT_DIR_BDR_RIGHT_TO_LEFT.
*/
#define WGL_CMD_GL_SET_BDR_TEXT_DIRECTION       WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 7)  

/**
This command gets the text direction attribute that defined in specific border. 

Output arguments

pv_param1	Contains the text direction value.It maybe WGL_TEXT_DIR_BDR_LEFT_TO_RIGHT or 
WGL_TEXT_DIR_BDR_RIGHT_TO_LEFT.

pv_param2	Reserve.

Returns

WGLR_OK	The command is successful.

WGLR_INV_ARG	The point is null.
*/
#define WGL_CMD_GL_GET_BDR_TEXT_DIRECTION       WGL_MAKE_BORDER_CMD(WGL_BORDER_BASE, 8)  

/*-----------------------------------------------------------------------------
                    Color Command Target definition
 ----------------------------------------------------------------------------*/
#define WGL_CLR_BDR_BK          (WGL_CLR_WGT_SPF_START+1)    /**< Indicates the color target is the outer border area of Uniform Border. */
#define WGL_CLR_BDR_FG          (WGL_CLR_WGT_SPF_START+2)    /**< Indicates the color target is the border body of Uniform Border. */

/*-----------------------------------------------------------------------------
                   Text Direction Command Target definition
 ----------------------------------------------------------------------------*/
#define WGL_TEXT_DIR_BDR_LEFT_TO_RIGHT  0x01    /**<Define the text direction si from left to right of special border. */
#define WGL_TEXT_DIR_BDR_RIGHT_TO_LEFT  0x02    /**<Define the text direction si from right to left of special border. */

#endif




/*----------------------------------------------------------------------------*/
/*! @} */   /* end of  groupMW_WGL*/
/*----------------------------------------------------------------------------*/



