text: //******************************************************************************
  //
  // Copyright (c) 2015 Microsoft Corporation. All rights reserved.
  //
  // This code is licensed under the MIT License (MIT).
  //
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  // THE SOFTWARE.
  //
  //******************************************************************************
  
  #pragma once
  #include "UIView.h"
  
  enum {
      UIControlEventTouchDown = 1 << 0,
      UIControlEventTouchDownRepeat = 1 << 1,
      UIControlEventTouchDragInside = 1 << 2,
      UIControlEventTouchDragOutside = 1 << 3,
      UIControlEventTouchDragEnter = 1 << 4,
      UIControlEventTouchDragExit = 1 << 5,
      UIControlEventTouchUpInside = 1 << 6,
      UIControlEventTouchUpOutside = 1 << 7,
      UIControlEventTouchCancel = 1 << 8,
  
      UIControlEventValueChanged = 1 << 12,
  
      UIControlEventEditingDidBegin = 1 << 16,
      UIControlEventEditingChanged = 1 << 17,
      UIControlEventEditingDidEnd = 1 << 18,
      UIControlEventEditingDidEndOnExit = 1 << 19,
  
      UIControlEventAllTouchEvents = 0x00000FFF,
      UIControlEventAllEditingEvents = 0x000F0000,
      UIControlEventApplicationReserved = 0x0F000000,
      UIControlEventSystemReserved = 0xF0000000,
      UIControlEventAllEvents = 0xFFFFFFFF
  };
  
  typedef enum {
      UIControlContentHorizontalAlignmentCenter = 0,
      UIControlContentHorizontalAlignmentLeft = 1,
      UIControlContentHorizontalAlignmentRight = 2,
      UIControlContentHorizontalAlignmentFill = 3,
  } UIControlContentHorizontalAlignment;
  
  typedef enum {
      UIControlContentVerticalAlignmentCenter = 0,
      UIControlContentVerticalAlignmentTop = 1,
      UIControlContentVerticalAlignmentBottom = 2,
      UIControlContentVerticalAlignmentFill = 3,
  } UIControlContentVerticalAlignment;
  
  class UIControl : public UIView {
  public:
      int _contentVerticalAlignment, _contentHorizontalAlignment;
  
      UIControl();
      virtual void InitFromXIB(XIBObject* obj);
      virtual void InitFromStory(XIBObject* obj);
      virtual void ConvertStaticMappings(NIBWriter* writer, XIBObject* obj);
  };
  