#ifndef __OOL_XCONTCOL_H__
#define __OOL_XCONTCOL_H__


/*===========================================================================*/
/* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
/*===========================================================================*/
/*                              class: XContainerColumn                      */
/*                       derived from: XObject                               */
/*                        last update: 9/96                                  */
/*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
/*===========================================================================*/


#include "xobject.h"

class XContainerControl;
#include "XIcon.h"
#include "XBitmap.h"


#ifdef OOL_FOR_OS2_X86

   //settings
   #define COL_LEFT			0x00000001
   #define COL_RIGHT			0x00000002
   #define COL_CENTER			0x00000004

   #define COL_TOP				0x00000008
   #define COL_VCENTER			0x00000010
   #define COL_BOTTOM			0x00000020

   #define COL_INVISIBLE			0x00000040

   #define COL_SEPARATOR			0x00000200
   #define COL_HORZSEPARATOR		0x00000400

   #define COL_BITMAPORICON		0x00000100
   #define COL_STRING			0x00000800
   #define COL_DATE			0x00002000
   #define COL_TIME			0x00004000
   #define COL_ULONG			0x00020000

   #define COL_FIREADONLY			0x00008000
   #define COL_FITITLEREADONLY		0x00010000
   #define COL_OWNERDRAW   CFA_OWNER
#endif

class _export_ XContainerColumn: public XObject
{
      friend XContainerControl;
      friend class XContainerInfo;
   private:
      FIELDINFO * info;
      XContainerControl * owner;
      SHORT col;
   public:
      XContainerColumn( XContainerControl * owner, void * titleData, SHORT dataColumn, LONG dataSettings = CFA_STRING|CFA_FIREADONLY , LONG titleSettings = CFA_LEFT | CFA_FITITLEREADONLY, LONG wight = 0);
      virtual ~XContainerColumn();
      XContainerColumn * GetNextColumn( void ) const { return info->pNextFieldInfo ? (XContainerColumn*) info->pNextFieldInfo->pUserData : 0; }
      LONG GetDataAttributes( void ) const { return info->flData; }
      SHORT GetColumnNumber(void) const { return col; }
      LONG GetTitleAttributes( void ) const { return info->flTitle; }
      void GetTitle( XString *);
      void SetDataAttributes( const LONG attr ) { info->flData = attr; }
      void SetTitleAttributes( const LONG attr ) { info->flTitle = attr; }
      void SetTitle( const char * p) { info->pTitleData = (char*) p; }
      void SetTitle( const XBitmap * p) { info->pTitleData = (void*) p->GetHandle(); }
      void SetTitle( const XIcon * p) { info->pTitleData = (void*) p->GetHandle(); }
};

#endif
