/*
*
*  Licensed to the Apache Software Foundation (ASF) under one or more
*  contributor license agreements.  See the NOTICE file distributed with
*  this work for additional information regarding copyright ownership.
*  The ASF licenses this file to You under the Apache License, Version 2.0
*  (the "License"); you may not use this file except in compliance with
*  the License.  You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*
*/

@namespace "library://ns.apache.org/royale/spark";

.royale *, . royale *:before, . royale *:after {
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

global {
    IStatesImpl:            ClassReference("org.apache.royale.core.StatesWithTransitionsImpl");
	IEffectTimer: 			ClassReference("org.apache.royale.utils.EffectTimer");
}

/* -------------------------------------------------------
 * Common Platform Styles
 * -------------------------------------------------------
 */


Button
{
    IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel");
	white-space: nowrap;
}
CheckBox
{
	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
}
ComboBox
{
	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ComboBoxModel");
	IBeadView: ClassReference("org.apache.royale.html.beads.ComboBoxView");
	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ComboBoxController");
	IPopUp: ClassReference("org.apache.royale.html.supportClasses.ComboBoxList");
}

GroupBase
{
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IBeadView: ClassReference("spark.components.beads.GroupView");
}

Image
{
	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageModel");
	IBeadView:  ClassReference("org.apache.royale.html.beads.ImageView");
}


DataGroup
{
	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.DataItemRendererFactoryForIListData");
	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionIListModel");
	IBeadView:  ClassReference("spark.components.beads.SparkDataContainerView");	
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory");
	IItemRenderer: ClassReference("spark.components.beads.SelfItemRenderer");
	IItemRendererInitializer: ClassReference("spark.components.beads.SelfItemRendererInitializer");
	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
}

VirtualVDataGroup
{
	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.VirtualDataItemRendererFactoryForIListData");
	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionIListModel");
	IBeadView:  ClassReference("spark.components.beads.VirtualListView");			
	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VirtualListVerticalLayout");
	IItemRendererClassFactory: ClassReference("org.apache.royale.core.SelectableItemRendererClassFactory");
	IItemRenderer: ClassReference("mx.controls.listClasses.ListItemRenderer");
	IItemRendererInitializer: ClassReference("mx.controls.beads.ListItemRendererInitializer");
	ISelectableItemRenderer: ClassReference("org.apache.royale.html.beads.SolidBackgroundSelectableItemRendererBead");
	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
}

NonVirtualHDataGroup
{
	IDataProviderItemRendererMapper: ClassReference("mx.controls.listClasses.DataItemRendererFactoryForIListData");
	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionIListModel");
	IBeadView:  ClassReference("spark.components.beads.SparkDataContainerView");	
	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
	IBeadLayout: ClassReference("spark.layouts.HorizontalLayout");
	IItemRendererClassFactory: ClassReference("org.apache.royale.core.SelectableItemRendererClassFactory");
	IItemRenderer: ClassReference("spark.components.supportClasses.SparkTextButtonItemRenderer");
	IItemRendererInitializer: ClassReference("spark.components.beads.TabBarItemRendererInitializer");
	ISelectableItemRenderer: ClassReference("org.apache.royale.html.beads.SolidBackgroundSelectableItemRendererBead");
	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
}

DropDownList
{
	IBeadModel: ClassReference("mx.controls.beads.models.SingleSelectionIListModel");
	IBeadView: ClassReference("spark.components.beads.DropDownListView");
	IBeadController: ClassReference("spark.components.beads.controllers.DropDownListController");
}

.DropDownDataGroup
{
	background-color: #FFFFFF;
	border: 1px solid #333333
}

Form
{
	skinClass: ClassReference("spark.skins.spark.FormSkin");
}

FormItem
{
	skinClass: ClassReference("spark.skins.spark.FormItemSkin");
}

List
{
	IBeadView: ClassReference("spark.components.beads.SparkContainerView");
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
	IContentView: ClassReference("spark.components.VirtualVDataGroup");
}

NumericStepper
{
	IBeadModel: ClassReference("org.apache.royale.html.beads.models.RangeModel");
	IBeadView: ClassReference("org.apache.royale.html.beads.NumericStepperView");
}
Panel
{
	IBeadModel: ClassReference("mx.containers.beads.models.PanelModel");
	IViewport: ClassReference("spark.components.beads.SparkSkinScrollingViewport");
	skinClass: ClassReference("spark.skins.spark.PanelSkin");
		
	background-color: #FFFFFF;
	border: 1px solid #333333
}

Panel .TitleBar
{
	border-bottom: 1px solid #333333;
}

.PanelContent
{
	background-color: #FFFFFF;
}

RichEditableText
{
	inactiveTextSelectionColor: #E8E8E8;
    focusedTextSelectionColor: #A8C6EE;
    unfocusedTextSelectionColor: #E8E8E8;
}

Scroller
{
	IBeadView: ClassReference("org.apache.royale.html.beads.GroupView");
}

SkinnableContainer
{
	IBeadView: ClassReference("spark.components.beads.SkinnableContainerView");
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IViewport: ClassReference("spark.components.beads.SparkSkinScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
	IContentView: ClassReference("spark.components.Group");
	border-width: 1px;
}

SkinnableDataContainer
{
	IBeadView: ClassReference("spark.components.beads.SkinnableDataContainerView");
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IViewport: ClassReference("spark.components.beads.SparkSkinScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
	IContentView: ClassReference("spark.components.DataGroup");
	border-width: 1px;
}

TabBar
{
	IBeadView: ClassReference("spark.components.beads.TabBarView");
	IBeadLayout: ClassReference("spark.layouts.supportClasses.SparkLayoutBead");
	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
	IContentView: ClassReference("spark.components.NonVirtualHDataGroup");
	IBeadController: ClassReference("spark.components.beads.controllers.TabBarController")
}

SparkTextButtonItemRenderer
{
	IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
}

TextInput
{
	border-color: #000000;
	border-width: 1px;
	background-color: #FFFFFF;
	font-size: 11px;
	font-family: Arial;
}

/* TextArea maps to an HTMLElement name so we can't use it because the compiler will
   geenrate a true TextArea Type Selector instead of a .TextArea class selector */
.SparkTextArea
{
	border-style: solid;
	border-color: #000000;
	border-width: 1px;
	background-color: #FFFFFF;
	width: 188px;
	height: 151px;
}

/* compiler thinks the above TextArea is for HTML TextArea so doesn't convert it to a 
   class selector */
.TextArea
{
	border-style: solid;
	border-color: #000000;
	border-width: 1px;
	background-color: #FFFFFF;
}

TitleWindow
{
	skinClass: ClassReference("spark.skins.spark.TitleWindowSkin");
}

.TitleBarCloseButton
{
	position: absolute;
	right: 17px;
	top: 8px;
}

/* -------------------------------------------------------
* SWF specific styles
* -------------------------------------------------------
*/

@media -royale-swf
{
	/* Global style declaration for Flash only.  This will effectively be the same
	   as the browser defaults */
	
	Button
	{
		IBeadView: ClassReference("mx.controls.beads.CSSImageAndTextButtonView");
	}
	CheckBox
	{
		IBeadView:  ClassReference("mx.controls.beads.CheckBoxView");			
	}
	
    SkinnableContainer
    {
	    IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
	    IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
    }

	SkinnableDataContainer
	{
		IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
		IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
	}

	Label
	{
		IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
		IBeadView: ClassReference("org.apache.royale.html.beads.TextFieldView");
		iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextFieldLabelMeasurementBead");
	}
	
	List
	{
		iBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
		iBorderBead: ClassReference('org.apache.royale.html.beads.SingleLineBorderBead');
		iBorderModel: ClassReference('org.apache.royale.html.beads.models.SingleLineBorderModel');
		font-size: 11px;
		font-family: Arial;
	}
		
	Panel
	{
		IContentView: ClassReference("org.apache.royale.html.supportClasses.ContainerContentArea");
		IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
		IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");    
	}
	
	RadioButton
	{
		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel");
		IBeadView:  ClassReference("mx.controls.beads.RadioButtonView");			
	}
	
	TextArea
	{
		IBeadModel: ClassReference("org.apache.royale.html.beads.models.NonNullTextModel");
		IBeadView: ClassReference("org.apache.royale.html.beads.TextAreaView");
		IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController");
		IBorderBead: ClassReference('org.apache.royale.html.beads.SingleLineBorderBead');
		IBorderModel: ClassReference('org.apache.royale.html.beads.models.SingleLineBorderModel');
		IBackgroundBead: ClassReference('org.apache.royale.html.beads.SolidBackgroundBead');
		border-style: solid;
		border-color: #000000;
		border-width: 1px;
		background-color: #FFFFFF;
		font-size: 11px;
		font-family: Arial;
	}
	
	TextInput
	{
		IBeadModel: ClassReference("org.apache.royale.html.beads.models.NonNullTextModel");
		IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView");
		IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController");
		IBorderBead: ClassReference('org.apache.royale.html.beads.SingleLineBorderBead');
		IBackgroundBead: ClassReference('org.apache.royale.html.beads.SolidBackgroundBead');
		border-style: solid;
		border-color: #000000;
		border-width: 1px;
		background-color: #FFFFFF;
		font-size: 11px;
		font-family: Arial;
	}
}
